package com.xiaomuwu.android.ui.rele

import androidx.fragment.app.Fragment
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.xiaomuwu.android.logic.Repository
import com.xiaomuwu.android.logic.model.ForReleUser
import com.xiaomuwu.android.logic.model.User

class ReleUserViewModel:ViewModel() {

    private val toReleUserLiveData= MutableLiveData<ForReleUser>()

    val releUserList=ArrayList<User>()

    var releUserLiveData= Transformations.switchMap(toReleUserLiveData){ forReleUser->
        Repository.getReleUser(forReleUser)
    }

    fun getReleUserLiveData(forReleUser: ForReleUser){
        toReleUserLiveData.value=forReleUser
    }

}